<extend name="base/index" />

	<block name="content">
	<!-- 页面部分 -->
			<!-- BEGIN CONTENT -->
		<div class="page-content-wrapper">
			<div class="page-content">

				<!-- BEGIN PAGE HEADER-->
				<h3 class="page-title">
				用户组管理 <small>用户列表</small>
				</h3>
				<div class="page-bar">
					<ul class="page-breadcrumb">
						<li>
							<i class="fa fa-home"></i>
							<a href="{:U('Admin')}">后台首页</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
								<a href="#">用户组列表</a>
								<i class="fa fa-angle-right"></i>
							</li>
						<li>
							<a href="#">成员列表</a>
						</li>
					</ul>
					<div class="page-toolbar">
						<div class="btn-group pull-right">
							<button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
							Actions <i class="fa fa-angle-down"></i>
							</button>
							<ul class="dropdown-menu pull-right" role="menu">
								<li>
									<a href="#">Action</a>
								</li>
								<li>
									<a href="#">Another action</a>
								</li>
								<li>
									<a href="#">Something else here</a>
								</li>
								<li class="divider">
								</li>
								<li>
									<a href="#">Separated link</a>
								</li>
							</ul>
						</div>
					</div>
				</div>
				<!-- END PAGE HEADER-->
				<!-- BEGIN PAGE CONTENT-->
				<div class="row">
					<div class="col-md-12">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box grey-cascade">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-globe"></i>成员列表
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse">
									</a>
									<a href="#portlet-config" data-toggle="modal" class="config">
									</a>
									<a href="javascript:;" class="reload">
									</a>
									<a href="javascript:;" class="remove">
									</a>
								</div>
							</div>
							<div class="portlet-body">
								<div class="table-toolbar">
									<div class="row">
										<div class="col-md-6">
											<div class="col-md-6">
											<input id="group_user_add_btn" class="form-control" type="text" placeholder="请输入用户名，例：admin"></div>
											<div class="btn-group">
												<a onClick="group_user_add({$gid})" id="sample_editable_1_new" class="btn green">
												添加新用户<i class="fa fa-plus"></i>
												</a>
											</div>
										</div>
										<div class="col-md-6">
											<div class="btn-group pull-right">
												<button class="btn dropdown-toggle" data-toggle="dropdown">功能 <i class="fa fa-angle-down"></i>
												</button>
												<ul class="dropdown-menu pull-right">
													<li>
														<a href="#">
														打印 </a>
													</li>
													<li>
														<a href="#">
														保存 </a>
													</li>
													<li>
														<a href="#">
														导出 </a>
													</li>
												</ul>
											</div>
										</div>
									</div>
								</div>
								<table class="table table-striped table-bordered table-hover" id="sample_1">
								<thead>
								<tr>
									<th><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" />ID</th>
											<th>用户名(昵称)</th>
											<th class="hidden-480">Email</th>
											<th class="hidden-480">QQ</th>
											<th class="hidden-480">登陆次数</th>
									<th >
								</tr>
								</thead>
								<tbody>
								<notempty name="_list">
								<volist name="_list" id="vo">
								<tr class="odd gradeX">
									<td>
										<input type="checkbox" class="checkboxes" value="{$vo.uid}"/>{$vo.uid}
									</td>
										<td>{$vo.nickname}({$vo.username})</td>
										<td class="hidden-480"><a href="mailto:{$vo.email}">{$vo.email}</a></td>
										<td class="hidden-480">{$vo.qq}</td>
										<td class="center hidden-480">{$vo.login}</td>
										<td ><a href="{:U('Admin/Auth/group_user_del')}?uid={$vo.uid}&gid={$gid}"><span class="badge badge-roundless badge-danger">踢出</span></a></td>
								</tr>
									</volist>
									<else/>
									<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
									</notempty>
								</tbody>
								</table>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
				<!-- END PAGE CONTENT-->
			</div>
		</div>
		<!-- END CONTENT -->
	<script>
		function group_user_add(gid){
			var username = $("#group_user_add_btn").val();
			if(username == ''){
				alert("用户名不能为空！");
				return;
			}
			
			$.get( CONTROLLER + "/gruop_user_add?gid="+gid+"&username="+username ,
				function(ret){
				alert(ret.info);
				if(ret.status == 1){
					location.reload();
					//刷新页面
				}
			});
		}
		</script>
	<!-- 页面部分 -->
	</block>

	<block name="script">
	<script src="__assets__/global/scripts/metronic.js" type="text/javascript"></script>
	<script src="__assets__/admin/layout2/scripts/layout.js" type="text/javascript"></script>
	<script src="__assets__/admin/layout2/scripts/demo.js" type="text/javascript"></script>
	<script src="__assets__/admin/pages/scripts/table-managed.js"></script>
	<script>
	jQuery(document).ready(function() {       
	   Metronic.init(); // init metronic core components
	Layout.init(); // init current layout
	Demo.init(); // init demo features
	   TableManaged.init();
	});
	</script>
	</block>